package no.group.gowther.exception;

/**
 * @author ayatsuji
 * @date 2022-03-05 22:30
 * @since
 */
public class BusinessException extends RuntimeException {
    private final Integer code;
    private final String errorMsg;

    protected BusinessException(Integer code, String errorMsg) {
        super(errorMsg);
        this.code = code;
        this.errorMsg = errorMsg;
    }

    public static BusinessException createException(Integer code, String errorMsg) {
        return new BusinessException(code, errorMsg);
    }

    public Integer getCode() {
        return code;
    }

    public String getErrorMsg() {
        return errorMsg;
    }
}
